package com.weic.easycache.http;

public class Http {
	public static final String CRLF = "\r\n";
	public static final String HTTPv1_1 = "HTTP/1.1";
	public static final String HTTPv = "HTTP/1.";
	public static final String URL_start = "http://";
	public static final String SEP_header = ": ";

	public static final int CODE_OK = 200;
	/**响应Range请求，正常返回的状态码**/
	public static final int CODE_range = 206;
	public static final int CODE_redirect = 302;

	public static final String POST = "POST";
	public static final String GET = "GET";

	public static final String REFERER = "Referer: ";
	public static final String HOST = "Host: ";
	public static final String LOCATION = "Location: ";

	public static final String CONTENT_LENGTH = "Content-Length: ";

	public static final String CONTENT_TYPE = "Content-Type: ";
	public static final String CONTENT_TYPE_mp4 = "video/mp4";
	public static final String CONTENT_TYPE_flv = "video/x-flv";

	public static final String CONNECTION = "Connection: ";

	public static final String K_host = "key_host";
	public static final String K_referer = "key_referer";
	public static final String K_resourse = "key_resourse";
	public static final String RESOURSE_sample = K_resourse+"="+URL_start+"www.x.com/x.x";

	public static class RequestHeader {
		public static final String K_Accept = "Accept";
		public static final String K_Accept_Charset = "Accept-Charset";
		public static final String K_Accept_Encoding = "Accept-Encoding";
		public static final String K_Accept_Language = "Accept-Language";
		public static final String K_Connection = "Connection";
		/**指定要下载的文件的起始和结束位置，e.g：bytes=500-600，表示下载从500到600offset的字节，
		 * 返回多一个字节：包含第600offset字节**/
		public static final String K_Range = "Range";
		public static final String K_Referer = "Referer";
		public static final String K_Host = "Host";
		public static final String K_User_Agent = "User-Agent";
		
		public static final String V_Accept = "text/html,application/xhtml+xml,application/xml,Application/josn;q=0.9,*/*;q=0.8";
		public static final String V_Accept_Charset = "GBK,utf-8;q=0.7,*;q=0.3";
		public static final String V_Accept_Encoding = "gzip,deflate,sdch";
		public static final String V_Accept_Language = "zh-CN,zh;q=0.8";
		public static final String V_Connection_kpalive = "keep-alive";
		public static final String V_Connection_close = "close";
		public static final String V_User_Agent =  "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11";
	}

	public static class ResponseHeader {
		public static final String K_Accept_Ranges = "Accept-Ranges";
		/**当前会返回的字节数，如果请求中有Range字段，则值为Range区间的字节数**/
		public static final String K_Content_Length = "Content-Length";
		/**用于描述当前下载的文件长度信息，e.g：bytes 500-600/1000。
		 * 表示总共1000字节，返回从500到600offset的字节，包含第600offset字节**/
		public static final String K_Content_Range = "Content-Range";
		public static final String K_Connection = "Connection";
		public static final String K_Location = "Location";
		/**用于描述文件名的。e.g：attachment;filename=xx.txt或者inline;filename=xx.txt
		 * attachment表示以附件方式下载。inline表示在页面中打开。**/
		public static final String K_Content_Disposition = "Content-Disposition";

		public static final String V_Accept_Ranges_bytes = "bytes";
		public static final String V_Accept_Ranges_none = "none";
		public static final String V_Connection_kpalive = "keep-alive";
		public static final String V_Connection_close = "close";
	}
}
